﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Configuration;
using Olympic_email_to_future.IBLL;
using Olympic_email_to_future.BLL;


namespace Olympic_email_to_future.BLLFactory
{
    public class BusinessFactory
    {
       private static readonly string path = ConfigurationManager.AppSettings["BLL"];

        private BusinessFactory() { }

        public static IBLL.IMailBLL CreateEmailBLL()
        {
            string className = path + ".MailBLL";
           
            return (IBLL.IMailBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static IAttachmentBLL CreateAttachmentBLL()
        {
            string className = path + ".AttachmentBLL";

            return (IAttachmentBLL)Assembly.Load(path).CreateInstance(className);
        }
        public static IBLL.IUserBLL CreateUserBLL()
        {
            string className = path + ".UserBLL";
            return (IBLL.IUserBLL)Assembly.Load(path).CreateInstance(className);
        }
        public static IBLL.IFeedbackBLL CreateFeedbackBLL()
        {
            string className = path + ".FeedbackBLL";
            return (IBLL.IFeedbackBLL)Assembly.Load(path).CreateInstance(className);
        }

    }
}
